package com.wanxi.controller;

import com.wanxi.entity.User;
import com.wanxi.result.CommonResult;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(description = "登录相关")
@RestController
@RequestMapping("/front")
public class FrontLoginController {
    @ApiOperation(value = "登录接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneNumber",value = "手机号",required = true),
            @ApiImplicitParam(name = "password",value = "密码",required = true),
            @ApiImplicitParam(name = "code",value = "验证码",required = true)
    })
    @ApiResponse(code = 200,message = "登录成功",response = User.class)
    @PostMapping("/login")
    public CommonResult login(String phoneNumber, String password, String code){
        return CommonResult.success(new User(),"登录成功");
    }

    @ApiOperation(value = "修改密码",response = CommonResult.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "编号",required = true),
            @ApiImplicitParam(name = "password",value = "密码",required = true),
            @ApiImplicitParam(name = "newPassword",value = "新密码",required = true)
    })
    @PostMapping("/updatePassword")
    public CommonResult updatePassword(Long id , String password, String newPassword){
        return CommonResult.success(null,"修改成功");
    }
}
